package com.example.demo.config;

import cn.jpush.api.JPushClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
@ConfigurationProperties(prefix = "push")
public class JiGuangConfig {
    /**
     * 极光官网-个人管理中心-appkey
     */
    private static final String appkey = "a6266b7167d8091623797e6f";

    /**
     * // 极光官网-个人管理中心-点击查看-secret
     */
    private static final String secret = "e17087f87123fa69ae4a0919";
    private JPushClient jPushClient;

    /**
     * 推送客户端
     */
    @PostConstruct
    public void initJPushClient() {
        jPushClient = new JPushClient(secret, appkey);
    }

    /**
     * 获取推送客户端
     * @return JPushClient
     */
    public JPushClient getJPushClient() {
        return jPushClient;
    }
}
